package com.yby.dome3;

/**
 * 汽车类
 */
public class Vehicle {
    final String brand;
    String color;
    double speed;

    public String getBrand() {
        return brand;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public double getSpeed() {
        return speed;
    }

    public void setSpeed(double speed) {
        this.speed = speed;
    }

    public Vehicle(String brand){
        this.brand = brand;
        double speed = 0.0;
    }
    public Vehicle(String brand,String color){
        this(brand);
        this.color = color;

    }
    public void run(){
        System.out.println(brand+",颜色:"+color+",速度为："+speed);
    }

    public static void main(String[] args) {
        Vehicle v = new Vehicle("benz","black");
        v.run();

    }
}
